##############################################
# create by: richard zhu
# modify: 2023-08-27
# build litewaf-server by django3
##############################################
FROM python:3.7.17-slim-bullseye
COPY ./litewafServer /usr/local/litewaf
WORKDIR /usr/local/litewaf

RUN sed -i "s/archive.ubuntu./mirrors.aliyun./g" /etc/apt/sources.list
RUN sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN apt-get update \
  && apt-get install -y vim less python3-dev git \
  && rm -rf /var/cache/apt/ \
  && cd /usr/local/litewaf  \
  && pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple --no-cache-dir \
  && rm -rf litewafServer/local_settings.py \
  && rm -rf logs/*.log

EXPOSE 8000
# CMD ["/usr/local/bin/gunicorn", "-c", "/usr/src/app/configs/gunicorn_config.py", "test_platform.wsgi"]
#CMD ["sleep 1000"]